package com.zeekr.myapplication3

import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.launch

class MyViewModel : ViewModel() {
    private val myTest = MyTest()
    private val myTest2 = MyTest2()

    fun test() {
        viewModelScope.launch {
            Log.i("ZZZZ", "start")
            val sss = myTest.myCall()
            Log.i("ZZZZ", "sss:$sss")
        }
    }

    fun test2() {
        viewModelScope.launch {
            Log.i("ZZZZ", "start2")
            val sss = myTest2.myCall()
            sss.collect {
                Log.i("ZZZZ", "sss2:$it")
            }
        }
    }

    fun test3() {
        viewModelScope.launch {
            Log.i("ZZZZ", "start3")
            val sss = myTest2.myCall2()
            sss.collect {
                Log.i("ZZZZ", "sss3:$it")
            }
        }
    }
}